package io.github.harmonly.skyblock.manager;

import io.github.harmonly.skyblock.command.*;

import java.util.HashMap;

public class CommandManager {

    private static final HashMap<String, SBCommand> map = new HashMap<>();

    public static void registerCommands() {
        // 这里可以调用具体命令类的注册方法
        registerCommand(new TestCommand());
        registerCommand(new LangCommand());
//        registerCommand(new OPCommand());
        registerCommand(new RankCommand());
        registerCommand(new PrefixCommand());
        registerCommand(new PlayCommand());
        registerCommand(new LobbyCommand());
        registerCommand(new WarpCommand());
        registerCommand(new NPCCommand());
        registerCommand(new GivePetCommand());
    }

    public static void registerCommand(SBCommand command) {
        map.put(command.name(), command);
        command.register();
    }

    public static void unregisterCommand(String key) {
        if (map.containsKey(key)) {
            map.get(key).unregister();
            map.remove(key);
        }
    }
}
